package com.token.iot.bratterycharging.gateway.api;

import java.io.Serializable;

import com.outstanding.framework.core.BaseEnum;

public enum StopReason implements BaseEnum<StopReason, String>,Serializable {
	/**  */
	Finish("0", "已经完成"),
	Manual("1", "手动停止"),
	//充满自停是给予一定的时长，在这个时长下，如果没有额定功率的电器接入，则自动停
	Auto("2", "充满自停"),
	Overload("4","因充电器功率过大"),
	Fault("3","因端口故障"),
	Refund("5","刷卡退费"),
	Unstart("6","开始充电但未接充电器"),
	;

	private String code;

	private String name;

	private StopReason(String code, String name) {
		this.code = code;
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	/**
	 * 通过枚举<code>code</code>获得枚举
	 * 
	 * @param code
	 *            code
	 * @return AccountType
	 */
	public static StopReason getByCode(String code) {
		for (StopReason acType : values()) {
			if (acType.getCode().equals(code)) {
				return acType;
			}
		}
		return null;
	}

	@Override
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@Override
	public String getMessage() {
		return this.name;
	}

}

